<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>学生宿舍信息</title>
    <style>
        * {
            text-decoration: none;
            color: inherit;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            box-sizing: border-box;
        }
        body {
            background: url('https://www.fjpit.edu.cn/_upload/article/images/85/0a/ace6605245f7aa03c4f70daef565/4859390e-bc87-42e1-896f-44386bc14740.png') no-repeat center center fixed;
            background-size: cover;
            margin: 0;
            padding: 0;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background-blend-mode: overlay;
        }
        .main {
            width: 85%;
            max-width: 1400px;
            background: rgba(255, 255, 255, 0.85);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            border-radius: 20px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .header, .footer {
            background: #0073e6;
            color: white;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .header {
            border-top-left-radius: 20px;
            border-top-right-radius: 20px;
        }
        .footer {
            background: #0073e6;
            color: white;
            padding: 20px;
            text-align: center;
            border-bottom-left-radius: 20px;
            border-bottom-right-radius: 20px;
            font-size: 1.1em;
            justify-content: center;
        }

        .footer img{
            width: 270px;
            height: 50px;

        }
        .header a, .footer a {
            color: white;
            margin-left: 30px;
            font-weight: bold;
        }
        .content {
            width: 969px;
            height: 445px;
            margin: 0 auto;
            padding: 20px;
            text-align: center;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .content h2 {
            margin-bottom: 5px;
            color: #0073e6;
            font-size: 2.5em;
        }
        .menu {
            margin: 20px 0;
            display: flex;
            justify-content: space-between;
        }
        .menu a {
            background: #0073e6;
            color: white;
            padding: 10px 20px;
            border-radius: 10px;
            text-decoration: none;
            transition: background 0.3s, transform 0.3s;
            font-size: 1em;
        }
        .menu a:hover {
            background: #005bb5;
            transform: scale(1.05);
        }
        .two {
            margin: 20px 0;
        }
        .two th, .two td {
            border: 1px solid #0073e6;
            padding: 10px;
        }
        .two table {
            width: 100%;
            border-collapse: collapse;
        }
        .two table thead {
            background: #0073e6;
            color: white;
        }
        .page-nav {
            margin: 20px 0;
            display: flex;
            justify-content: center;
        }
        .page-nav a {
            margin: 0 10px;
            color: #0073e6;
            text-decoration: none;
        }
        .page-nav a.pageActive {
            color: black;
            margin-bottom: 5px;
        }
    </style>
</head>
<body>
<div class="main">
    <div class="header">
        <p>欢迎您，管理员</p>
    </div>
    <div class="content">
        <h2>学生宿舍列表</h2>
        <div class="menu">
            <a href="main.jsp">返回系统</a>
            <a href="addEmp.html">添加宿舍</a>
        </div>
        <div class="two">
            <table>
                <thead>
                <tr>
                    <th>编号</th>
                    <th>宿舍号</th>
                    <th>是否满员</th>
                    <th>楼层</th>
                    <th>人数</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="employee" items="${requestScope.pageDTO.date}">
                    <tr>
                        <td>${employee.id}</td>
                        <td>${employee.empName}</td>
                        <td>${employee.empGender}</td>
                        <td>${employee.empDept}</td>
                        <td>${employee.empSalary}</td>
                        <td><a href="findById?id=${employee.id}">修改</a> <a href="delEmp?id=${employee.id}">删除</a></td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
        <div class="page-nav">
            <c:if test="${pageDTO.pageNumber>1}">
                <a href="empList?pageNumber=${pageDTO.pageNumber -1}">上一页</a>
            </c:if>
            <c:forEach var="i" begin="1" end="${pageDTO.totalPage}">
                <a href="empList?pageNumber=${i}" class="${i == pageDTO.pageNumber ? 'pageActive' : ''}">${i}</a>
            </c:forEach>
            <c:if test="${pageDTO.pageNumber < pageDTO.totalPage}">
                <a href="empList?pageNumber=${pageDTO.pageNumber+1}">下一页</a>
            </c:if>
        </div>
    </div>

</div>
</body>
</html>
